(function($){
	$.extend({
		uuid: function() {
			return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
				var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
				return v.toString(16);
			});
		},
		
		maskWeb:function(options){
			var uuid = $.uuid();
			var block_id = $.uuid();
			var defaults = {
				message: '',
				time:0
			};
			
			var opts = $.extend(defaults, options);
			
			var tmpl = '<div id="{block_id}"><div id="{uuid}" class="mask" style="z-index:10000"></div>'
				+ '<div class="mask-body">{message}</div></div>';
			
			tmpl = tmpl.replace('{block_id}', block_id);
			tmpl = tmpl.replace('{uuid}', uuid);
			tmpl = tmpl.replace('{message}',opts.message);
			$('body').append(tmpl);
			
			if(opts.time > 0){
				var t = parseInt(opts.time);
				setTimeout(function(){
					$('#' + block_id).remove();
				},t);
			}
			return block_id;
		},
		unmaskWeb:function(mask_id){
			$('#' + mask_id).remove();
		},
		toastWeb : function(options){
			var uuid = $.uuid();
			var defaults = {
					message: '弹出消息'
			};
			var opts = $.extend(defaults, options);
			var tmpl = '<div id="{uuid}" class="toast-big-body"><div class="toast-body"><span>{message}</span></div></div>';
			tmpl = tmpl.replace('{uuid}', uuid);
			tmpl = tmpl.replace('{message}',opts.message);
			$('body').append(tmpl);
			setTimeout(function(){
				$('#' + uuid).hide(1000,function(){
					$('#' + uuid).remove();
				});
			},1000);
		}
	});
})(jQuery);